#include<bits/stdc++.h>
using namespace std;
const int n = 30;
const unsigned int best_seed = 3014696961;
int a[111][111];
bool svd[111][111];
int c[3][2] = {{1,2},{0,2},{0,1}};
int E(int x,int y)
{
	return (3 - x - y);
}
int F(int x,int y,int k)
{
	if(x == y)
		return c[x][k];
	else
		return E(x,y);
}
void Run(unsigned int seed)
{
	mt19937 Rnd(seed);
	for(int i = 1;i <= n;i++)
		for(int j = 1;j <= n;j++)
			svd[i][j] = 0;
	a[1][1] = a[1][2] = a[2][1] = Rnd() % 3;
	a[1][n] = a[1][n - 1] = a[2][n] = Rnd() % 3;
	a[n][1] = a[n][2] = a[n - 1][1] = Rnd() % 3;
	a[n][n] = a[n][n - 1] = a[n - 1][n] = Rnd() % 3;
	for(int i = 3;i < n - 3;i++)
	{
		a[1][i] = c[a[1][i - 2]][Rnd() & 1];
		a[i][1] = c[a[i - 2][1]][Rnd() & 1];
		a[n][i] = c[a[n][i - 2]][Rnd() & 1];
		a[i][n] = c[a[i - 2][n]][Rnd() & 1];
	}
	a[1][n - 2] = F(a[1][n - 4],a[1][n],Rnd() & 1),a[1][n - 3] = F(a[1][n - 5],a[1][n - 1],Rnd() & 1);
	a[n][n - 2] = F(a[n][n - 4],a[n][n],Rnd() & 1),a[n][n - 3] = F(a[n][n - 5],a[n][n - 1],Rnd() & 1);
	a[n - 2][1] = F(a[n - 4][1],a[n][1],Rnd() & 1),a[n - 3][1] = F(a[n - 5][1],a[n - 1][1],Rnd() & 1);
	a[n - 2][n] = F(a[n - 4][n],a[n][n],Rnd() & 1),a[n - 3][n] = F(a[n - 5][n],a[n - 1][n],Rnd() & 1);
	for(int i = 2;i < n;i++)
		a[2][i] = E(a[1][i - 1],a[1][i + 1]),a[i][2] = E(a[i - 1][1],a[i + 1][1]),a[n - 1][i] = E(a[n][i - 1],a[n][i + 1]),a[i][n - 1] = E(a[i - 1][n],a[i + 1][n]);
	for(int k = 2;1 + k <= n - k;k++)
	{
		for(int i = 1 + k;i <= n - k;i++)
		{
			if(a[k - 1][i] == a[k][i - 1] || a[k - 1][i] == a[k][i + 1] || a[k][i - 1] == a[k][i + 1])
				svd[k + 1][i] = 1,a[k + 1][i] = E(min({a[k - 1][i],a[k][i - 1],a[k][i + 1]}),max({a[k - 1][i],a[k][i - 1],a[k][i + 1]}));
			if(a[i][k - 1] == a[i - 1][k] || a[i][k - 1] == a[i + 1][k] || a[i - 1][k] == a[i + 1][k])
				svd[i][k + 1] = 1,a[i][k + 1] = E(min({a[i][k - 1],a[i - 1][k],a[i + 1][k]}),max({a[i][k - 1],a[i - 1][k],a[i + 1][k]}));
			if(a[n - k + 2][i] == a[n - k + 1][i - 1] || a[n - k + 2][i] == a[n - k + 1][i + 1] || a[n - k + 1][i - 1] == a[n - k + 1][i + 1])
				svd[n - k][i] = 1,a[n - k][i] = E(min({a[n - k + 2][i],a[n - k + 1][i - 1],a[n - k + 1][i + 1]}),max({a[n - k + 2][i],a[n - k + 1][i - 1],a[n - k + 1][i + 1]}));
			if(a[i][n - k + 2] == a[i - 1][n - k + 1] || a[i][n - k + 2] == a[i + 1][n - k + 1] || a[i - 1][n - k + 1] == a[i + 1][n - k + 1])
				svd[i][n - k] = 1,a[i][n - k] = E(min({a[i][n - k + 2],a[i - 1][n - k + 1],a[i + 1][n - k + 1]}),max({a[i][n - k + 2],a[i - 1][n - k + 1],a[i + 1][n - k + 1]}));
		}
		for(int i = 1 + k;i <= n - k;i++)
		{
			if(!svd[k + 1][i])
				a[k + 1][i] = E(a[k][i - 1],a[k][i + 1]);
			if(!svd[i][k + 1])
				a[i][k + 1] = E(a[i - 1][k],a[i + 1][k]);
			if(!svd[n - k][i])
				a[n - k][i] = E(a[n - k + 1][i - 1],a[n - k + 1][i + 1]);
			if(!svd[i][n - k])
				a[i][n - k] = E(a[i - 1][n - k + 1],a[i + 1][n - k + 1]);
		}
	}
}
int l;
char s[1000011];
int b[1000011];
char d[3] = {'R','G','B'};
char ans[1000011];
int sx,sy;
void End()
{
	cout << sx << ' ' << sy << "\n";
	for(int i = 1;i < l;i++)
		cout << ans[i];
	exit(0);
}
void DFS(int x,int y,int p)
{
	if(!x || !y || x > n || y > n || a[x][y] != b[p])
		return;
	if(p == l)
		End();
	ans[p] = 'U',DFS(x - 1,y,p + 1);
	ans[p] = 'L',DFS(x,y - 1,p + 1);
	ans[p] = 'D',DFS(x + 1,y,p + 1);
	ans[p] = 'R',DFS(x,y + 1,p + 1);
}
pair<int,int> pos[n * n + 11];
int main()
{
	srand(time(0));
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	freopen("snake.in","r",stdin);
	freopen("snake.out","w",stdout);
	Run(best_seed);
	cout << n << " " << n << "\n";
	for(int i = 1;i <= n;i++)
	{
		for(int j = 1;j <= n;j++)
			cout << d[a[i][j]];
		cout << "\n";
	}
	cin >> s;
	l = strlen(s);
	for(int i = 1;i <= l;i++)
	{
		if(s[i - 1] == 'R')
			b[i] = 0;
		else if(s[i - 1] == 'G')
			b[i] = 1;
		else
			b[i] = 2;
	}
	int idx = 0;
	for(int i = 1;i <= n;i++)
		for(int j = 1;j <= n;j++)
			pos[++idx] = {i,j};
	random_shuffle(pos + 1,pos + idx + 1);
	for(int i = 1;i <= idx;i++)
		DFS(sx = pos[i].first,sy = pos[i].second,1);
	return 0;
}
